#!/usr/bin/python3
"""
Description: setup up the A-ops manager service.
"""
import os
from setuptools import find_packages, setup
from distutils.sysconfig import get_python_lib

TEMPLATE = os.path.join(get_python_lib(), "zeus", "operation_service", "templates")
RESOURCE = os.path.join(get_python_lib(), "zeus", "operation_service", "resource")

HTML = os.path.join(get_python_lib(), "zeus", "operation_service", "templates", "html")
TOOLS = os.path.join(get_python_lib(), "zeus", "operation_service", "app", "core", "asset", "tools")
DATA_COLLECT = os.path.join(get_python_lib(), "zeus", "operation_service", "app", "core", "framework", "agent", "data_collect_tools")
AGENT = os.path.join(get_python_lib(), "zeus", "operation_service", "app", "core", "framework", "agent")
setup(
    name='zeus-operation',
    version='1.0.0',
    packages=find_packages(),
    install_requires=[
        'marshmallow>=3.13.0',
        'Flask',
        'Flask-RESTful',
        'requests',
        'SQLAlchemy',
        'paramiko>=2.11.0',
        "redis",
        'gevent',
        "retrying",
    ],
    data_files=[
        ('/etc/aops/conf.d', ['zeus-operation.yml']),
        ('/usr/lib/systemd/system', ["zeus-operation.service"]),
        ("/opt/aops/database", ["zeus/operation_service/database/zeus-operation.sql"]),
        (
            TEMPLATE,
            [
                "zeus/operation_service/templates/workflow_template.yml",
                "zeus/operation_service/templates/data_collect_workflow.yml",
                "zeus/operation_service/templates/health_check_workflow.yml",
            ],
        ),
        (
            RESOURCE,
            [
                "zeus/operation_service/resource/en-US/i18n_en_US.properties",
                "zeus/operation_service/resource/zh-CN/i18n_zh_CN.properties",
            ],
        ),
        (HTML, ["zeus/operation_service/templates/html/ItemHealthCheckTemplate.html"]),
        (HTML, ["zeus/operation_service/templates/html/ItemSecurityManageTemplate.html"]),
        (HTML, ["zeus/operation_service/templates/html/ItemSummary.html"]),
        (HTML, ["zeus/operation_service/templates/html/ItemSummarySecurityManage.html"]),
        (HTML, ["zeus/operation_service/templates/html/NodeHealthCheckTemplate.html"]),
        (HTML, ["zeus/operation_service/templates/html/NodeSecurityManageTemplate.html"]),
        (HTML, ["zeus/operation_service/templates/html/NodeSummary.html"]),
        (HTML, ["zeus/operation_service/templates/html/NodeSummarySecurityManage.html"]),
        (TOOLS, ["zeus/operation_service/app/core/asset/tools/package_asset.sh"]),
        (DATA_COLLECT, ["zeus/operation_service/app/core/framework/agent/data_collect_tools/collect.sh"]),
        (DATA_COLLECT, ["zeus/operation_service/app/core/framework/agent/data_collect_tools/common_lib.sh"]),
        (AGENT, ["zeus/operation_service/app/core/framework/agent/sudoexecute.sh"]),
    ],
    zip_safe=False,
)
